package com.fnzx.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: Wang Zhifu
 * @create: 2021/11/16 17:28
 * @Description:
 */
@RestController
public class BaseController {
    @GetMapping("/prod-api/vue-element-admin/user/info")
    public JSONObject info(){
        return JSONObject.parseObject("{\n" +
                "  \"code\": 20000,\n" +
                "  \"data\": {\n" +
                "    \"roles\": [\n" +
                "      \"admin\"\n" +
                "    ],\n" +
                "    \"introduction\": \"I am a super administrator\",\n" +
                "    \"avatar\": \"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif\",\n" +
                "    \"name\": \"Super Admin\"\n" +
                "  }\n" +
                "}");
    }

    @PostMapping("/prod-api/vue-element-admin/user/logout")
    public JSONObject logout(){
        return JSONObject.parseObject("{\n" +
                "  \"code\": 20000,\n" +
                "  \"data\": \"success\"\n" +
                "}");

    }
}
